package april.test_4_12;

import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            char[][] arr = new char[28][28];
            String str ;
            for (int i = 0; i < 20; i++) {
                str = scanner.nextLine();
                for (int j = 0; j < 20; j++) {
                    arr[i + 4][j + 4] = str.charAt(j);
                }
            }
            boolean tmp = false;
            for (int i = 4; i < 24; i++) {
                for (int j = 4; j < 24; j++) {
                    if(arr[i][j] == '*' || arr[i][j] == '+') {
                        if(isWin(arr[i][j],arr,i,j)) {
                            System.out.println("Yes");
                            tmp = true;
                            break;
                        }
                    }
                }
                if (tmp) {
                    break;
                }
            }
            if(!tmp) {
                System.out.println("No");
            }
        }
    }
    private static boolean isWin(char c,char[][] arr,int i,int j) {
        for (int count = 0; count < 5; count++) {
            boolean win1 = true;
            boolean win2 = true;
            boolean win3 = true;
            boolean win4 = true;
            for (int q = 1; q <= count; q++) {
                if(arr[i - q][j] != c){
                    win1 = false;
                }
                if(arr[i][j - q] != c) {
                    win2 = false;
                }
                if(arr[i - q][j - q] != c) {
                    win3 = false;
                }
                if(arr[i + q][j - q] != c) {
                    win4 = false;
                }
            }
            for (int h = 1; h <= 4 - count;h++) {
                if(arr[i + h][j] != c) {
                    win1 = false;
                }
                if(arr[i][j + h] != c) {
                    win2 = false;
                }
                if(arr[i + h][j + h] != c) {
                    win3 = false;
                }
                if(arr[i - h][j + h] != c) {
                    win4 = false;
                }
            }
            if (win1 || win2 || win3 || win4) {
                return true;
            }
        }
        return false;
    }
}
